unit upasserversocashdrawer03;
{$I \source.75\common\LogOption.txt}

interface
uses
  SysUtils,
  upasserversocashdrawer,
  upascashdrawerso03;

type
  EOupasserversocashdrawer03 = class(EOupasserversocashdrawer)
  private
    // The UPAS SO Interface
    FUPASSO: EOupascashdrawerso03;

    FOPOSLDN: String;
    FOpenStatus: Integer;
    FClaimStatus: Integer;

  protected
    procedure OnCharEvent(Value: String); override;
    procedure OnStringEvent(Value: String); override;
    procedure OnXMLEvent(Value: String); override;

    // Common Properties getter/setter
    function getAutoDisable: Boolean; override;
    function getBinaryConversion: Integer; override;
    function getCapCompareFirmwareVersion: Boolean; override;
    function getCapPowerReporting: Integer; override;
    function getCapStatisticsReporting: Boolean; override;
    function getCapUpdateFirmware: Boolean; override;
    function getCapUpdateStatistics: Boolean; override;
    function getCheckHealthText: String; override;
    function getClaimed: Boolean; override;
    function getControlObjectDescription: String; override;
    function getControlObjectVersion: Integer; override;
    function getDataCount: Boolean; override;
    function getDataEventEnabled: Boolean; override;
    function getDeviceControlDescription: String; override;
    function getDeviceControlVersion: Integer; override;
    function getDeviceDescription: String; override;
    function getDeviceEnabled: Boolean; override;
    function getDeviceName: String; override;
    function getDeviceServiceDescription: String; override;
    function getDeviceServiceVersion: Integer; override;
    function getFreezeEvents: Boolean; override;
    function getOpenResult: Integer; override;
    function getOutpuID: Integer; override;
    function getPhysicalDeviceDescription: String; override;
    function getPhysicalDeviceName: String; override;
    function getPowerNotify: Integer; override;
    function getPowerState: Integer; override;
    function getResultCode: Integer; override;
    function getResultCodeExtended: Integer; override;
    function getServiceObjectDescription: String; override;
    function getServiceObjectVersion: Integer; override;
    function getState: Integer; override;
    procedure setAutoDisable(Value: Boolean); override;
    procedure setBinaryConversion(Value: Integer); override;
    procedure setDataEventEnabled(Value: Boolean); override;
    procedure setDeviceEnabled(Value: Boolean); override;
    procedure setFreezeEvents(Value: Boolean); override;
    procedure setPowerNotify(Value: Integer); override;

    // CashDrawer Properties getter/setter
    function getCapStatus: WordBool; override;
    function getCapStatusMultiDrawerDetect: WordBool; override;
    function getDrawerOpened: WordBool; override;

  public
    // Common Methods
    function CheckHealth(Level: Integer): Integer; override;
    function ClaimDevice(Timeout: Integer): Integer; override;
    function ClearInput: Integer; override;
    function ClearInputProperties: Integer; override;
    function ClearOutput: Integer; override;
    function Close: Integer; override;
    function CompareFirmwareVersion(const FirmwareFileName: WideString; out pResult: Integer): Integer; override;
    function DirectIO(Command: Integer; var pData: Integer; var pString: WideString): Integer; override;
    function Open(const DeviceName: String): Integer; override;
    function ReleaseDevice: Integer; override;
    function ResetStatistics(const StatisticsBuffer: WideString): Integer; override;
    function RetrieveStatistics(var pStatisticsBuffer: WideString): Integer; override;
    function UpdateFirmware(const FirmwareFileName: WideString): Integer; override;
    function UpdateStatistics(const StatisticsBuffer: WideString): Integer; override;

    // CashDrawer Methods
    function OpenDrawer: Integer; override;
    function WaitForDrawerClose(BeepTimeout: Integer; BeepFrequency: Integer; BeepDuration: Integer; BeepDelay: Integer): Integer;  override;

    constructor Create(DeviceName: String);
    destructor Destroy; override;

  end;

implementation
uses
  AuditLog,
  opos;

procedure EOupasserversocashdrawer03.OnCharEvent(Value: String);
begin
  {$IFDEF LOGUNITTEST}
  AuditLog.EventLog(AuditLog.etDUNIT, EOupasserversocashdrawer03.ClassName + '.OnXMLEvent', 'Value="' + Value + '"');
  {$ENDIF}

  Inherited;

  OpenDrawer;
end;

procedure EOupasserversocashdrawer03.OnStringEvent(Value: String);
begin
  {$IFDEF LOGUNITTEST}
  AuditLog.EventLog(AuditLog.etDUNIT, EOupasserversocashdrawer03.ClassName + '.OnStringEvent', 'Value="' + Value + '"');
  {$ENDIF}

  Inherited;

  OpenDrawer;
end;

procedure EOupasserversocashdrawer03.OnXMLEvent(Value: String);
begin
  {$IFDEF LOGUNITTEST}
  AuditLog.EventLog(AuditLog.etDUNIT, EOupasserversocashdrawer03.ClassName + '.OnXMLEvent', 'Value="' + Value + '"');
  {$ENDIF}

  Inherited;

  OpenDrawer;
end;

function EOupasserversocashdrawer03.getCapStatus: WordBool;
begin
  {$IFDEF LOGUNITTEST}
  AuditLog.EventLog(AuditLog.etDUNIT, EOupasserversocashdrawer03.ClassName + '.getCapStatus', '');
  {$ENDIF}

  Result := FUPASSO.CapStatus;
end;

function EOupasserversocashdrawer03.getCapPowerReporting: Integer;
begin
  {$IFDEF LOGUNITTEST}
  AuditLog.EventLog(AuditLog.etDUNIT, EOupasserversocashdrawer03.ClassName + '.getCapPowerReporting', '');
  {$ENDIF}

  Result := FUPASSO.CapPowerReporting;
end;

function EOupasserversocashdrawer03.getCapStatusMultiDrawerDetect: WordBool;
begin
  {$IFDEF LOGUNITTEST}
  AuditLog.EventLog(AuditLog.etDUNIT, EOupasserversocashdrawer03.ClassName + '.getCapStatusMultiDrawerDetect', '');
  {$ENDIF}

  Result := FUPASSO.CapStatusMultiDrawerDetect;
end;

function EOupasserversocashdrawer03.getCapStatisticsReporting: Boolean;
begin
  {$IFDEF LOGUNITTEST}
  AuditLog.EventLog(AuditLog.etDUNIT, EOupasserversocashdrawer03.ClassName + '.getCapStatisticsReporting', '');
  {$ENDIF}

  Result := FUPASSO.CapStatisticsReporting;
end;

function EOupasserversocashdrawer03.getCapUpdateStatistics: Boolean;
begin
  {$IFDEF LOGUNITTEST}
  AuditLog.EventLog(AuditLog.etDUNIT, EOupasserversocashdrawer03.ClassName + '.getCapUpdateStatistics', '');
  {$ENDIF}

  Result := FUPASSO.CapUpdateStatistics;
end;

function EOupasserversocashdrawer03.getCapCompareFirmwareVersion: Boolean;
begin
  {$IFDEF LOGUNITTEST}
  AuditLog.EventLog(AuditLog.etDUNIT, EOupasserversocashdrawer03.ClassName + '.getCapCompareFirmwareVersion', '');
  {$ENDIF}

  Result := FUPASSO.CapCompareFirmwareVersion;
end;

function EOupasserversocashdrawer03.getCapUpdateFirmware: Boolean;
begin
  {$IFDEF LOGUNITTEST}
  AuditLog.EventLog(AuditLog.etDUNIT, EOupasserversocashdrawer03.ClassName + '.getCapUpdateFirmware', '');
  {$ENDIF}

  Result := FUPASSO.CapUpdateFirmware;
end;

function EOupasserversocashdrawer03.getDrawerOpened: WordBool;
begin
  {$IFDEF LOGUNITTEST}
  AuditLog.EventLog(AuditLog.etDUNIT, EOupasserversocashdrawer03.ClassName + '.getDrawerOpened', '');
  {$ENDIF}

  Result := FUPASSO.DrawerOpened;
end;

function EOupasserversocashdrawer03.getOpenResult: Integer;
begin
  {$IFDEF LOGUNITTEST}
  AuditLog.EventLog(AuditLog.etDUNIT, EOupasserversocashdrawer03.ClassName + '.getOpenResult', '');
  {$ENDIF}

  Result := FUPASSO.OpenResult;
end;

function EOupasserversocashdrawer03.getOutpuID: Integer;
begin
  {$IFDEF LOGUNITTEST}
  AuditLog.EventLog(AuditLog.etDUNIT, EOupasserversocashdrawer03.ClassName + '.getOutpuID', 'OPOS_E_FAILURE');
  {$ENDIF}

  Result := opos.OPOS_E_FAILURE;
end;

function EOupasserversocashdrawer03.getPhysicalDeviceDescription: String;
begin
  {$IFDEF LOGUNITTEST}
  AuditLog.EventLog(AuditLog.etDUNIT, EOupasserversocashdrawer03.ClassName + '.getPhysicalDeviceDescription', '');
  {$ENDIF}

  Result := '';
end;

function EOupasserversocashdrawer03.getPhysicalDeviceName: String;
begin
  {$IFDEF LOGUNITTEST}
  AuditLog.EventLog(AuditLog.etDUNIT, EOupasserversocashdrawer03.ClassName + '.getPhysicalDeviceName', '');
  {$ENDIF}

  Result := '';
end;

function EOupasserversocashdrawer03.getCheckHealthText: String;
begin
  {$IFDEF LOGUNITTEST}
  AuditLog.EventLog(AuditLog.etDUNIT, EOupasserversocashdrawer03.ClassName + '.getCheckHealthText', '');
  {$ENDIF}

  Result := FUPASSO.CheckHealthText;
end;

function EOupasserversocashdrawer03.getClaimed: Boolean;
begin
  {$IFDEF LOGUNITTEST}
  AuditLog.EventLog(AuditLog.etDUNIT, EOupasserversocashdrawer03.ClassName + '.getClaimed', '');
  {$ENDIF}

  Result := FUPASSO.Claimed;
end;

function EOupasserversocashdrawer03.getResultCode: Integer;
begin
  {$IFDEF LOGUNITTEST}
  AuditLog.EventLog(AuditLog.etDUNIT, EOupasserversocashdrawer03.ClassName + '.getResultCode', '');
  {$ENDIF}

  Result := FUPASSO.ResultCode;
end;

function EOupasserversocashdrawer03.getResultCodeExtended: Integer;
begin
  {$IFDEF LOGUNITTEST}
  AuditLog.EventLog(AuditLog.etDUNIT, EOupasserversocashdrawer03.ClassName + '.getResultCodeExtended', '');
  {$ENDIF}

  Result := FUPASSO.ResultCodeExtended;
end;

function EOupasserversocashdrawer03.getState: Integer;
begin
  {$IFDEF LOGUNITTEST}
  AuditLog.EventLog(AuditLog.etDUNIT, EOupasserversocashdrawer03.ClassName + '.getState', '');
  {$ENDIF}

  Result := FUPASSO.State;
end;

procedure EOupasserversocashdrawer03.setAutoDisable(Value: Boolean);
begin
  {$IFDEF LOGUNITTEST}
  AuditLog.EventLog(AuditLog.etDUNIT, EOupasserversocashdrawer03.ClassName + '.setAutoDisable', '');
  {$ENDIF}
end;

function EOupasserversocashdrawer03.getControlObjectDescription: String;
begin
  {$IFDEF LOGUNITTEST}
  AuditLog.EventLog(AuditLog.etDUNIT, EOupasserversocashdrawer03.ClassName + '.getControlObjectDescription', '');
  {$ENDIF}

  Result := FUPASSO.ControlObjectDescription;
end;

function EOupasserversocashdrawer03.getControlObjectVersion: Integer;
begin
  {$IFDEF LOGUNITTEST}
  AuditLog.EventLog(AuditLog.etDUNIT, EOupasserversocashdrawer03.ClassName + '.getControlObjectVersion', '');
  {$ENDIF}

  Result := FUPASSO.ControlObjectVersion;
end;

function EOupasserversocashdrawer03.getDataCount: Boolean;
begin
  {$IFDEF LOGUNITTEST}
  AuditLog.EventLog(AuditLog.etDUNIT, EOupasserversocashdrawer03.ClassName + '.getDataCount', 'OPOS_E_FAILURE');
  {$ENDIF}

  Result := False;
end;

function EOupasserversocashdrawer03.getDataEventEnabled: Boolean;
begin
  {$IFDEF LOGUNITTEST}
  AuditLog.EventLog(AuditLog.etDUNIT, EOupasserversocashdrawer03.ClassName + '.getDataEventEnabled', 'OPOS_E_FAILURE');
  {$ENDIF}

  Result := False;
end;

function EOupasserversocashdrawer03.getDeviceControlDescription: String;
begin
  {$IFDEF LOGUNITTEST}
  AuditLog.EventLog(AuditLog.etDUNIT, EOupasserversocashdrawer03.ClassName + '.getDeviceControlDescription', 'OPOS_E_FAILURE');
  {$ENDIF}

  Result := '';
end;

function EOupasserversocashdrawer03.getDeviceControlVersion: Integer;
begin
  {$IFDEF LOGUNITTEST}
  AuditLog.EventLog(AuditLog.etDUNIT, EOupasserversocashdrawer03.ClassName + '.getDeviceControlVersion', 'OPOS_E_FAILURE');
  {$ENDIF}

  Result := opos.OPOS_E_FAILURE;
end;

function EOupasserversocashdrawer03.getServiceObjectDescription: String;
begin
  {$IFDEF LOGUNITTEST}
  AuditLog.EventLog(AuditLog.etDUNIT, EOupasserversocashdrawer03.ClassName + '.getServiceObjectDescription', '');
  {$ENDIF}

  Result := FUPASSO.ServiceObjectDescription;
end;

function EOupasserversocashdrawer03.getServiceObjectVersion: Integer;
begin
  {$IFDEF LOGUNITTEST}
  AuditLog.EventLog(AuditLog.etDUNIT, EOupasserversocashdrawer03.ClassName + '.getServiceObjectVersion', '');
  {$ENDIF}

  Result := FUPASSO.ServiceObjectVersion;
end;

function EOupasserversocashdrawer03.getDeviceDescription: String;
begin
  {$IFDEF LOGUNITTEST}
  AuditLog.EventLog(AuditLog.etDUNIT, EOupasserversocashdrawer03.ClassName + '.getDeviceDescription', '');
  {$ENDIF}

  Result := FUPASSO.DeviceDescription;
end;

function EOupasserversocashdrawer03.getDeviceName: String;
begin
  {$IFDEF LOGUNITTEST}
  AuditLog.EventLog(AuditLog.etDUNIT, EOupasserversocashdrawer03.ClassName + '.getDeviceName', '');
  {$ENDIF}

  Result := FUPASSO.DeviceName;
end;

function EOupasserversocashdrawer03.getDeviceServiceDescription: String;
begin
  {$IFDEF LOGUNITTEST}
  AuditLog.EventLog(AuditLog.etDUNIT, EOupasserversocashdrawer03.ClassName + '.getDeviceServiceDescription', '');
  {$ENDIF}

  Result := '';
end;

function EOupasserversocashdrawer03.getDeviceServiceVersion: Integer;
begin
  {$IFDEF LOGUNITTEST}
  AuditLog.EventLog(AuditLog.etDUNIT, EOupasserversocashdrawer03.ClassName + '.getDeviceServiceVersion', 'OPOS_E_FAILURE');
  {$ENDIF}

  Result := opos.OPOS_E_FAILURE;
end;

function EOupasserversocashdrawer03.getPowerState: Integer;
begin
  {$IFDEF LOGUNITTEST}
  AuditLog.EventLog(AuditLog.etDUNIT, EOupasserversocashdrawer03.ClassName + '.getPowerState', '');
  {$ENDIF}

  Result := FUPASSO.PowerState;
end;

function EOupasserversocashdrawer03.getDeviceEnabled: Boolean;
begin
  {$IFDEF LOGUNITTEST}
  AuditLog.EventLog(AuditLog.etDUNIT, EOupasserversocashdrawer03.ClassName + '.getDeviceEnabled', '');
  {$ENDIF}

  Result := FUPASSO.DeviceEnabled;
end;

procedure EOupasserversocashdrawer03.setDeviceEnabled(Value: Boolean);
begin
  {$IFDEF LOGUNITTEST}
  AuditLog.EventLog(AuditLog.etDUNIT, EOupasserversocashdrawer03.ClassName + '.setDeviceEnabled', '');
  {$ENDIF}

  FUPASSO.DeviceEnabled := Value;
end;

function EOupasserversocashdrawer03.getFreezeEvents: Boolean;
begin
  {$IFDEF LOGUNITTEST}
  AuditLog.EventLog(AuditLog.etDUNIT, EOupasserversocashdrawer03.ClassName + '.getFreezeEvents', '');
  {$ENDIF}

  Result := FUPASSO.FreezeEvents;
end;

procedure EOupasserversocashdrawer03.setFreezeEvents(Value: Boolean);
begin
  {$IFDEF LOGUNITTEST}
  AuditLog.EventLog(AuditLog.etDUNIT, EOupasserversocashdrawer03.ClassName + '.setFreezeEvents', '');
  {$ENDIF}

  FUPASSO.FreezeEvents := Value;
end;

function EOupasserversocashdrawer03.getAutoDisable: Boolean;
begin
  {$IFDEF LOGUNITTEST}
  AuditLog.EventLog(AuditLog.etDUNIT, EOupasserversocashdrawer03.ClassName + '.getAutoDisable', 'OPOS_E_FAILURE');
  {$ENDIF}

  Result := False;
end;

function EOupasserversocashdrawer03.getBinaryConversion: Integer;
begin
  {$IFDEF LOGUNITTEST}
  AuditLog.EventLog(AuditLog.etDUNIT, EOupasserversocashdrawer03.ClassName + '.getBinaryConversion', '');
  {$ENDIF}

  Result := FUPASSO.BinaryConversion;
end;

procedure EOupasserversocashdrawer03.setBinaryConversion(Value: Integer);
begin
  {$IFDEF LOGUNITTEST}
  AuditLog.EventLog(AuditLog.etDUNIT, EOupasserversocashdrawer03.ClassName + '.setBinaryConversion', '');
  {$ENDIF}

  FUPASSO.BinaryConversion := Value;
end;

procedure EOupasserversocashdrawer03.setDataEventEnabled(Value: Boolean);
begin
  {$IFDEF LOGUNITTEST}
  AuditLog.EventLog(AuditLog.etDUNIT, EOupasserversocashdrawer03.ClassName + '.setDataEventEnabled', '');
  {$ENDIF}
end;

function EOupasserversocashdrawer03.getPowerNotify: Integer;
begin
  {$IFDEF LOGUNITTEST}
  AuditLog.EventLog(AuditLog.etDUNIT, EOupasserversocashdrawer03.ClassName + '.getPowerNotify', '');
  {$ENDIF}

  Result := FUPASSO.PowerNotify;
end;

procedure EOupasserversocashdrawer03.setPowerNotify(Value: Integer);
begin
  {$IFDEF LOGUNITTEST}
  AuditLog.EventLog(AuditLog.etDUNIT, EOupasserversocashdrawer03.ClassName + '.setPowerNotify', '');
  {$ENDIF}

  FUPASSO.PowerNotify := Value;
end;

function EOupasserversocashdrawer03.CheckHealth(Level: Integer): Integer;
begin
  {$IFDEF LOGUNITTEST}
  AuditLog.EventLog(AuditLog.etDUNIT, EOupasserversocashdrawer03.ClassName + '.CheckHealth', '');
  {$ENDIF}

  Result := FUPASSO.CheckHealth(Level);
end;

function EOupasserversocashdrawer03.ClaimDevice(Timeout: Integer): Integer;
begin
  {$IFDEF LOGUNITTEST}
  AuditLog.EventLog(AuditLog.etDUNIT, EOupasserversocashdrawer03.ClassName + '.ClaimDevice', '');
  {$ENDIF}

  Result := FUPASSO.ClaimDevice(Timeout);
end;

function EOupasserversocashdrawer03.ClearInput: Integer;
begin
  {$IFDEF LOGUNITTEST}
  AuditLog.EventLog(AuditLog.etDUNIT, EOupasserversocashdrawer03.ClassName + '.ClearInput', 'OPOS_E_FAILURE');
  {$ENDIF}

  Result :=  opos.OPOS_E_FAILURE;
end;

function EOupasserversocashdrawer03.ClearInputProperties: Integer;
begin
  {$IFDEF LOGUNITTEST}
  AuditLog.EventLog(AuditLog.etDUNIT, EOupasserversocashdrawer03.ClassName + '.ClearInputProperties', 'OPOS_E_FAILURE');
  {$ENDIF}

  Result :=  opos.OPOS_E_FAILURE;
end;

function EOupasserversocashdrawer03.ClearOutput: Integer;
begin
  {$IFDEF LOGUNITTEST}
  AuditLog.EventLog(AuditLog.etDUNIT, EOupasserversocashdrawer03.ClassName + '.ClearOutput', 'OPOS_E_FAILURE');
  {$ENDIF}

  Result :=  opos.OPOS_E_FAILURE;
end;

function EOupasserversocashdrawer03.Close: Integer;
begin
  {$IFDEF LOGUNITTEST}
  AuditLog.EventLog(AuditLog.etDUNIT, EOupasserversocashdrawer03.ClassName + '.Close', '');
  {$ENDIF}

  Result := FUPASSO.Close;
end;

function EOupasserversocashdrawer03.CompareFirmwareVersion(const FirmwareFileName: WideString; out pResult: Integer): Integer;
begin
  {$IFDEF LOGUNITTEST}
  AuditLog.EventLog(AuditLog.etDUNIT, EOupasserversocashdrawer03.ClassName + '.CompareFirmwareVersion', '');
  {$ENDIF}

  Result := FUPASSO.CompareFirmwareVersion(FirmwareFileName, pResult);
end;

function EOupasserversocashdrawer03.DirectIO(Command: Integer; var pData: Integer; var pString: WideString): Integer;
begin
  {$IFDEF LOGUNITTEST}
  AuditLog.EventLog(AuditLog.etDUNIT, EOupasserversocashdrawer03.ClassName + '.DirectIO', '');
  {$ENDIF}

  Result := FUPASSO.DirectIO(Command, pData, pString);
end;

function EOupasserversocashdrawer03.Open(const DeviceName: String): Integer;
begin
  {$IFDEF LOGUNITTEST}
  AuditLog.EventLog(AuditLog.etDUNIT, EOupasserversocashdrawer03.ClassName + '.Open', '');
  {$ENDIF}

  Result := FUPASSO.Open(DeviceName);
end;

function EOupasserversocashdrawer03.OpenDrawer: Integer;
begin
  {$IFDEF LOGUNITTEST}
  AuditLog.EventLog(AuditLog.etDUNIT, EOupasserversocashdrawer03.ClassName + '.OpenDrawer', '');
  {$ENDIF}

  Result := FUPASSO.OpenDrawer;
end;

function EOupasserversocashdrawer03.ReleaseDevice: Integer;
begin
  {$IFDEF LOGUNITTEST}
  AuditLog.EventLog(AuditLog.etDUNIT, EOupasserversocashdrawer03.ClassName + '.ReleaseDevice', '');
  {$ENDIF}

  Result := FUPASSO.ReleaseDevice;
end;

function EOupasserversocashdrawer03.ResetStatistics(const StatisticsBuffer: WideString): Integer;
begin
  {$IFDEF LOGUNITTEST}
  AuditLog.EventLog(AuditLog.etDUNIT, EOupasserversocashdrawer03.ClassName + '.ResetStatistics', '');
  {$ENDIF}

  Result := FUPASSO.ResetStatistics(StatisticsBuffer);
end;

function EOupasserversocashdrawer03.RetrieveStatistics(var pStatisticsBuffer: WideString): Integer;
begin
  {$IFDEF LOGUNITTEST}
  AuditLog.EventLog(AuditLog.etDUNIT, EOupasserversocashdrawer03.ClassName + '.RetrieveStatistics', '');
  {$ENDIF}

  Result := FUPASSO.RetrieveStatistics(pStatisticsBuffer);
end;

function EOupasserversocashdrawer03.UpdateFirmware(const FirmwareFileName: WideString): Integer;
begin
  {$IFDEF LOGUNITTEST}
  AuditLog.EventLog(AuditLog.etDUNIT, EOupasserversocashdrawer03.ClassName + '.UpdateFirmware', '');
  {$ENDIF}

  Result := FUPASSO.UpdateFirmware(FirmwareFileName);
end;

function EOupasserversocashdrawer03.UpdateStatistics(const StatisticsBuffer: WideString): Integer;
begin
  {$IFDEF LOGUNITTEST}
  AuditLog.EventLog(AuditLog.etDUNIT, EOupasserversocashdrawer03.ClassName + '.UpdateStatistics', '');
  {$ENDIF}

  Result := FUPASSO.UpdateStatistics(StatisticsBuffer);
end;

function EOupasserversocashdrawer03.WaitForDrawerClose(BeepTimeout: Integer; BeepFrequency: Integer; BeepDuration: Integer; BeepDelay: Integer): Integer;
begin
  {$IFDEF LOGUNITTEST}
  AuditLog.EventLog(AuditLog.etDUNIT, EOupasserversocashdrawer03.ClassName + '.WaitForDrawerClose', '');
  {$ENDIF}

  Result := FUPASSO.WaitForDrawerClose(BeepTimeout, BeepFrequency, BeepDuration, BeepDelay);
end;

constructor EOupasserversocashdrawer03.Create(DeviceName: String);
begin
  {$IFDEF LOGUNITTEST}
  AuditLog.EventLog(AuditLog.etDUNIT, EOupasserversocashdrawer03.ClassName + '.Create', 'DeviceName="' + DeviceName + '"');
  {$ENDIF}

  Inherited Create(DeviceName);

  try
    FUPASSO := EOupascashdrawerso03.Create;
  except
    on E: Exception do begin
      AuditLog.EventLog(AuditLog.etException, EOupasserversocashdrawer03.ClassName, EOupascashdrawerso03.ClassName + ' ' + E.Message);
    end;
  end;

  FUPASSO.OnDirectIOEvent := OnDirectIOEvent;
  FUPASSO.OnStatusUpdateEvent := OnStatusUpdateEvent;

  FOpenStatus := FUPASSO.Open(FOPOSLDN);
  {$IFDEF LOGUNITTEST}
  AuditLog.EventLog(AuditLog.etDUNIT, EOupasserversocashdrawer03.ClassName + '.Create', 'FOpenStatus="' + IntToStr(FOpenStatus) + '"');
  {$ENDIF}

  FClaimStatus := opos.OPOS_E_CLAIMED;
  {$IFDEF LOGUNITTEST}
  AuditLog.EventLog(AuditLog.etDUNIT, EOupasserversocashdrawer03.ClassName + '.Create', 'FClaimStatus="' + IntToStr(FClaimStatus) + '"');
  {$ENDIF}
end;

destructor EOupasserversocashdrawer03.Destroy;
begin
  {$IFDEF LOGUNITTEST}
  AuditLog.EventLog(AuditLog.etDUNIT, EOupasserversocashdrawer03.ClassName + '.Destroy', '');
  {$ENDIF}

  Inherited;
end;

end.

